package home1ess.passport.pojo.param;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.FieldDefaults;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
@FieldDefaults(level = lombok.AccessLevel.PRIVATE)
public class UserUpdatePasswordParam implements Serializable {
    //注册时手机号就是用户名phone_number字段当用户名使
    @NotBlank(message = "用户名不能为空")
    @Pattern(regexp = "[A-Za-z0-9]+", message = "用户名只能包含字母和数字")
    @ApiModelProperty(value = "用户名", required = true,example = "admin")
    String phoneNumber;

    @NotBlank(message = "旧密码不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9]{6,15}$",message = "密码由大小写字母和数字组成，并且长度在 6 到 20 个字符之间")
    @ApiModelProperty(value = "旧密码", required = true)
    String oldPassword;

    @NotBlank(message = "新密码不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9]{6,15}$",message = "密码由大小写字母和数字组成，并且长度在 6 到 20 个字符之间")
    @ApiModelProperty(value = "新密码", required = true)
    String newPassword;

    @NotBlank(message = "确认密码密码不能为空")
    @Pattern(regexp = "^[a-zA-Z0-9]{6,15}$",message = "密码由大小写字母和数字组成，并且长度在 6 到 20 个字符之间")
    @ApiModelProperty(value = "确认密码", required = true)
    String newPasswordTwo;
}
